package com.jt.mapper;

import com.jt.pojo.User;
import com.jt.vo.PageResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
public interface UserMapper {

    @Select("select * from user")
    List<User> findAll();

    @Select("select * from user where username = #{username} and password = #{password}")
    User findUserByUP(User user);

    List<User> getUserList(PageResult pageResult);

//    long getTotal();
    long getTotal(String query);

    List<User> findUserListByPage(@Param("start") int start,
                                  @Param("size") int size,
                                  @Param("query") String query);

    /*    List<User> findUserListByPage(@Param("start") int start,
                                      @Param("size") int size);*/
    void updateStatus(User user);

    void addUser(User user);

    User findUserById(int id);

    Integer updateUser(User user);

    void deleteUserById(User user);

}
